package com.ckerchina.admin.ckadmin.service.sms.providerImpl;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import com.ckerchina.admin.ckadmin.service.sms.SMSServiceProvider;
import com.ckerchina.admin.ckadmin.service.sms.dto.SmsReceiveReport;
import com.ckerchina.admin.ckadmin.service.sms.dto.SmsSendResult;
import com.ckerchina.admin.ckadmin.service.sms.dto.SmsStatusReport;
import com.ckerchina.admin.ckadmin.service.sms.util.MengWangSmsUtil;

@Component
public class MengWangMarketingProvider implements SMSServiceProvider {

	private String URL = "";
	private String userName = "";
	private String password = "";

	public SmsSendResult sendMessage(String mobiles, String content) {
		return MengWangSmsUtil.sendMessage(mobiles, content, URL, userName, password);
	}

	public SmsSendResult sendMessage(String[] mobileArray, String content) {
		String mobiles = StringUtils.join(mobileArray, ",");
		return this.sendMessage(mobiles, content);
	}

	public Integer queryBalance() {
		return MengWangSmsUtil.queryBalance(URL, userName, password);
	}

	public List<SmsStatusReport> queryStatusReport() {
		return MengWangSmsUtil.queryStatusReport(URL, userName, password);
	}

	public List<SmsReceiveReport> receiveMessage() {
		return MengWangSmsUtil.receiveMessage(URL, userName, password);
	}

	@Override
	public SmsSendResult sendVMS(String mobiles, String code) {
		return null;
	}

	@Override
	public List<SmsStatusReport> queryVMSStatusReport() {
		return null;
	}

}
